
import Vue from 'vue'
import Vuex  from 'vuex'
// 数据持久化
import user from './user/user'
import createPersistedState from './vuex-persistedstate/vuex-persistedstate'
Vue.use(Vuex)
const store = new Vuex.Store({
		plugins: [
			createPersistedState({
				storage: {
					getItem: key => uni.getStorageSync(key),
					setItem: (key, value) => uni.setStorageSync(key, value),
					removeItem: key => uni.removeStorageSync(key)
				}
			})
		],
	state:{
	},
	mutations:{
	},
	actions: {
		// 异步操作
	},
  modules: {
		user,
  },

})
export default store